<?php
function custom_comment($comment, $args, $depth) {
   $GLOBALS['comment'] = $comment; ?>
                 
<?php ?>

	<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
    
    	<a name="comment-<?php comment_ID() ?>"></a>
      	
      	<div class="comment-container">

			<?php if(get_comment_type() == "comment"){ ?>
            
            <div class="avatar"><?php the_commenter_avatar($args) ?></div>
        
            <?php } ?>
      	    
            <div class="comment-right">
                    
                <div class="comment-head">
                                
                    <span class="name left"><?php the_commenter_link() ?></span>
                    
                    <?php if(get_comment_type() == "comment"){ ?>
                    
                        <span class="date right"><a href="<?php echo get_comment_link(); ?>" title="<?php _e('Direct link to this comment', 'themejunkie'); ?>"><?php echo get_comment_date() ?></a></span>
                    <?php }?>
                    
                        <span class="edit right"><?php edit_comment_link('Edit', '', ''); ?></span>
                                        
                </div> <!--end: comment-head -->
              
                <div class="comment-entry"  id="comment-<?php comment_ID(); ?>">
                
                    <?php comment_text() ?>
                    
                    <span class="reply left"><?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></span>
                    
                    <?php if ($comment->comment_approved == '0') { ?>
                        <p class='unapproved'><?php _e('Your comment is awaiting moderation.', 'themejunkie'); ?></p>
                    <?php } ?>
                    
        			<div class="clear"></div>
                </div> <!--end: comment-entry -->
            
            </div> <!--end: comment-right -->
		
		</div> <!--end: comment-container -->
		
<?php
}

function the_commenter_link() {
    $commenter = get_comment_author_link();
    if ( ereg( ']* class=[^>]+>', $commenter ) ) {$commenter = ereg_replace( '(]* class=[\'"]?)', '\\1url ' , $commenter );
    } else { $commenter = ereg_replace( '(<a )/', '\\1class="url "' , $commenter );}
    echo $commenter ;
}

function the_commenter_avatar($args) {
    $email = get_comment_author_email();
    $avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( "$email",  $args['avatar_size']) );
    echo $avatar;
}

?>